Integrand size = 21, antiderivative size = 133 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\frac {3 a^2 b \text {arctanh}(\sin (c+d x))}{d}+\frac {3 b^3 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {a^3 \cot (c+d x)}{d}-\frac {3 a b^2 \cot (c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan (c+d x)}{d} \]
[Out]
Time = 0.35 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.00, number of steps used = 15, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.476, Rules used = {3957, 2991, 3852, 8, 2701, 327, 213, 2700, 14, 294} \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a^2 b \text {arctanh}(\sin (c+d x))}{d}-\frac {3 a^2 b \csc (c+d x)}{d}+\frac {3 a b^2 \tan (c+d x)}{d}-\frac {3 a b^2 \cot (c+d x)}{d}+\frac {3 b^3 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d} \]
[In]
[Out]
Rule 8
Rule 14
Rule 213
Rule 294
Rule 327
Rule 2700
Rule 2701
Rule 2991
Rule 3852
Rule 3957
Rubi steps \begin{align*} \text {integral}& = -\int (-b-a \cos (c+d x))^3 \csc ^2(c+d x) \sec ^3(c+d x) \, dx \\ & = \int \left (a^3 \csc ^2(c+d x)+3 a^2 b \csc ^2(c+d x) \sec (c+d x)+3 a b^2 \csc ^2(c+d x) \sec ^2(c+d x)+b^3 \csc ^2(c+d x) \sec ^3(c+d x)\right ) \, dx \\ & = a^3 \int \csc ^2(c+d x) \, dx+\left (3 a^2 b\right ) \int \csc ^2(c+d x) \sec (c+d x) \, dx+\left (3 a b^2\right ) \int \csc ^2(c+d x) \sec ^2(c+d x) \, dx+b^3 \int \csc ^2(c+d x) \sec ^3(c+d x) \, dx \\ & = -\frac {a^3 \text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}-\frac {\left (3 a^2 b\right ) \text {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}+\frac {\left (3 a b^2\right ) \text {Subst}\left (\int \frac {1+x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}-\frac {b^3 \text {Subst}\left (\int \frac {x^4}{\left (-1+x^2\right )^2} \, dx,x,\csc (c+d x)\right )}{d} \\ & = -\frac {a^3 \cot (c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d}-\frac {\left (3 a^2 b\right ) \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}+\frac {\left (3 a b^2\right ) \text {Subst}\left (\int \left (1+\frac {1}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}-\frac {\left (3 b^3\right ) \text {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{2 d} \\ & = \frac {3 a^2 b \text {arctanh}(\sin (c+d x))}{d}-\frac {a^3 \cot (c+d x)}{d}-\frac {3 a b^2 \cot (c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan (c+d x)}{d}-\frac {\left (3 b^3\right ) \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{2 d} \\ & = \frac {3 a^2 b \text {arctanh}(\sin (c+d x))}{d}+\frac {3 b^3 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {a^3 \cot (c+d x)}{d}-\frac {3 a b^2 \cot (c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan (c+d x)}{d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(406\) vs. \(2(133)=266\).
Time = 2.44 (sec) , antiderivative size = 406, normalized size of antiderivative = 3.05 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=-\frac {\csc ^5\left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (12 a^2 b+2 b^3+6 a \left (a^2+2 b^2\right ) \cos (c+d x)+6 \left (2 a^2 b+b^3\right ) \cos (2 (c+d x))+2 a^3 \cos (3 (c+d x))+12 a b^2 \cos (3 (c+d x))+6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+3 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-3 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))+3 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))-6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))-3 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))\right )}{16 d \left (-1+\cot ^2\left (\frac {1}{2} (c+d x)\right )\right )^2} \]
[In]
[Out]
Time = 1.05 (sec) , antiderivative size = 129, normalized size of antiderivative = 0.97
method | result | size |
derivativedivides | \(\frac {-a^{3} \cot \left (d x +c \right )+3 a^{2} b \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+b^{3} \left (\frac {1}{2 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{2}}-\frac {3}{2 \sin \left (d x +c \right )}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(129\) |
default | \(\frac {-a^{3} \cot \left (d x +c \right )+3 a^{2} b \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+b^{3} \left (\frac {1}{2 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{2}}-\frac {3}{2 \sin \left (d x +c \right )}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(129\) |
parallelrisch | \(\frac {-3 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}+\frac {b^{2}}{2}\right ) b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+3 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}+\frac {b^{2}}{2}\right ) b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {3 \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\left (2 a^{2} b +b^{3}\right ) \cos \left (2 d x +2 c \right )+\left (\frac {1}{3} a^{3}+2 a \,b^{2}\right ) \cos \left (3 d x +3 c \right )+\left (a^{3}+2 a \,b^{2}\right ) \cos \left (d x +c \right )+2 a^{2} b +\frac {b^{3}}{3}\right )}{4}}{d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(181\) |
norman | \(\frac {-\frac {a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}}{2 d}+\frac {\left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{2 d}-\frac {3 \left (a^{3}-a^{2} b +7 a \,b^{2}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2 d}+\frac {3 \left (a^{3}+a^{2} b +7 a \,b^{2}+b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{2 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {3 b \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {3 b \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(216\) |
risch | \(-\frac {i \left (6 a^{2} b \,{\mathrm e}^{5 i \left (d x +c \right )}+3 b^{3} {\mathrm e}^{5 i \left (d x +c \right )}+2 a^{3} {\mathrm e}^{4 i \left (d x +c \right )}+12 a^{2} b \,{\mathrm e}^{3 i \left (d x +c \right )}+2 b^{3} {\mathrm e}^{3 i \left (d x +c \right )}+4 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}+12 a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}+3 b^{3} {\mathrm e}^{i \left (d x +c \right )}+2 a^{3}+12 a \,b^{2}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d}-\frac {3 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d}+\frac {3 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}\) | \(262\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.14 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\frac {3 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 3 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 12 \, a b^{2} \cos \left (d x + c\right ) - 4 \, {\left (a^{3} + 6 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 2 \, b^{3} - 6 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2}}{4 \, d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )} \]
[In]
[Out]
\[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{3} \csc ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.21 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.05 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=-\frac {b^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} - 2\right )}}{\sin \left (d x + c\right )^{3} - \sin \left (d x + c\right )} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, a^{2} b {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, a b^{2} {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} + \frac {4 \, a^{3}}{\tan \left (d x + c\right )}}{4 \, d} \]
[In]
[Out]
none
Time = 0.35 (sec) , antiderivative size = 225, normalized size of antiderivative = 1.69 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\frac {a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, {\left (2 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (2 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 14.09 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.36 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (6\,a^2\,b+3\,b^3\right )}{d}-\frac {3\,a\,b^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^3+6\,a^2\,b+18\,a\,b^2+4\,b^3\right )+3\,a^2\,b+a^3+b^3+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a^3+3\,a^2\,b+15\,a\,b^2-b^3\right )}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a-b\right )}^3}{2\,d} \]
[In]
[Out]